package com.kly.user.db.dao.impl;

import com.fqgj.common.base.AbstractBaseMapper;
import com.kly.user.db.dao.IssueUserDao;
import com.kly.user.db.dbo.IssueUserDBO;
import com.kly.user.db.entity.IssueUserEntity;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * User: user
 * Date: 2023-10-31
 * Time: 17:43:29.818
 */

@Repository
public class IssueUserDaoImpl extends AbstractBaseMapper<IssueUserEntity> implements IssueUserDao {

    @Override
    public int deleteNotUse() {
        return this.getSqlSession().delete(this.getStatement("deleteNotUse"));
    }

    @Override
    public int updateUseStatus() {
        return this.getSqlSession().update(this.getStatement("updateUseStatus"));
    }

    @Override
    public int updateConnectCount(List<String> userCodeList) {
        Map<String, Object> selectUsersParams = new HashMap<>();
        selectUsersParams.put("list", userCodeList);
        return this.getSqlSession().update(this.getStatement("updateConnectCount"), selectUsersParams);
    }

    @Override
    public int insertLocation(IssueUserDBO issueUserDBO) {
        return this.getSqlSession().insert(this.getStatement("insertLocation"), issueUserDBO);
    }
}